package dao

import (
	"lib/structs/tables"
)

var ClientLogDao = new(clientLogDao)

type clientLogDao struct{}

func (d clientLogDao) Create(m *tables.AmsClientLog) (err error) {
	err = DB.Create(&m).Error
	return
}

func (d clientLogDao) FindDetails(cid int64, logCode string) (m tables.AmsClientLog, err error) {
	err = DB.Where(&tables.AmsClientLog{ClientId: cid, LogCode: logCode}).
		Order("id desc").Limit(1).Find(&m).Error
	return
}
